package com.prueba.client.configuracion;

import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.layout.VLayout;


public class TablaPreferencias extends VLayout{
	static public TablaPreferencias getInstance(){
		if (singleton==null){
			singleton=new TablaPreferencias();
		}
		return singleton;
	}
	static private TablaPreferencias singleton=null;

	
	private TablaPreferencias(){
		super();
        
		//this.setCanDragReposition(false);
        this.addMember(PreferencesListGrid.getInstance());
        PreferencesListGrid.getInstance().setAlign(Alignment.CENTER);
        this.setWidth100();  
        this.setHeight100();   
        this.setAlign(Alignment.CENTER);
		this.setPadding(5);
	}
	

	static class PreferencesListGrid extends ListGrid{
		static PreferencesListGrid getInstance(){
			if (singleton==null){
				singleton=new PreferencesListGrid();
			}
			return singleton;
		}
		static private PreferencesListGrid singleton=null;
		
		private PreferencesListGrid(){
		     
			this.setCanEdit(true);              
		     this.setCanDragResize(true);
		        this.setWidth(500);  
		        this.setHeight(500);  
		        this.setHeaderHeight(40);  

				this.setDataSource(com.prueba.client.datos.PreferenciasData.getInstance());
				this.setAutoFetchData(true);
					        
		        
		     /*   ListGridField stakeholderField = new ListGridField("stakeholder", "Stakeholder");  
		        	stakeholderField.setAlign(Alignment.CENTER);  
		        	stakeholderField.setCanEdit(false);	
		        	
		        	
		        //module views
		        ListGridField decompositionField = new ListGridField("decomposition", "decomposition");  
		        decompositionField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        ListGridField usesField = new ListGridField("uses", "uses"); 
		        usesField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        ListGridField generalizationField = new ListGridField("generalization", "generalization"); 
		        generalizationField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        ListGridField layeredField = new ListGridField("layered", "layered"); 
		        layeredField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        ListGridField dataModelField = new ListGridField("dataModel", "data model"); 
		        dataModelField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        
		        //c&c views
		        ListGridField variousField = new ListGridField("various", "various"); 
		        variousField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        //allocation views
		        ListGridField deploymentField = new ListGridField("deployment", "deployment"); 
		        deploymentField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        ListGridField implementationField = new ListGridField("implementation", "implementation"); 
		        implementationField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        ListGridField installField = new ListGridField("install", "install"); 
		        installField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        ListGridField workAssignmentField = new ListGridField("workAssignment", "work Assignment"); 
		        workAssignmentField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        //others
		        ListGridField othersField = new ListGridField("others", "others"); 
		        othersField.setValueMap("nada","pantallazo","poco detalle","mucho detalle");
		        
		        
		        
		        this.setFields(stakeholderField,
		        		decompositionField,usesField,generalizationField,layeredField,dataModelField,
		        		variousField,
		        		deploymentField,implementationField,installField,workAssignmentField,
		        		othersField);
		        this.setHeaderSpans(  
		                new HeaderSpan("Module views", new String[]{"decomposition","uses","generalization","layered","dataModel"}),  
		                new HeaderSpan("C&C views", new String[]{"various"}),  
		                new HeaderSpan("Allocation views", new String[]{"deployment","implementation","install","workAssignment"}));  
		        */

		}

	}

}
